<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>Layui</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link rel="shortcut icon" href="../resources/favicon.ico" th:href="@{/static/favicon.ico}"/>
    <link rel="stylesheet" href="/layui/css/layui.css"  media="all">
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>


<!--justify-content: space-between;-->
<div style="display: flex;margin-left: 20px;margin-top: 20px">

<form class="layui-form layui-form-pane" action="">
        <div class="layui-form-item" >

            <div class="layui-inline">
            <label class="layui-form-label">接口地址:</label>
            <div class="layui-input-inline">
                <input type="text" name="apiname" id="apiname" placeholder="请输入接口地址" class="layui-input" >
            </div>
            </div>

        </div>
</form>

    <div class="layui-inline" style="margin-right: 20px">
        <button  id="search_btn" class="layui-btn layui-btn-normal"><i class="layui-icon"></i> 搜 索</button>
    </div>
</div>
<div style="margin-left: 20px;margin-right: 20px">
    <table class="layui-show" id="swaggerLogTable" ></table>
</div>

<script src="/layui/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述 JS 路径需要改成你本地的 -->
<script>
    layui.use(['element', 'table', 'layer'], function () {
        var $ = layui.jquery,
            element = layui.element,
            layer = layui.layer,
            form = layui.form,
            table = layui.table;

            table.render({
                elem: "#swaggerLogTable",
                url: "/va/swaggerLogList?name="+$("#apiname").val(),
                cols: [
                [
                    {field: 'id', title: 'ID', width: 100, sort: true}
                    ,{field: 'kindName', title: '模块', minWidth: 100}
                    ,{field: 'method', title: '请求方式', width: 100}
                    ,{field: 'name', title: '接口地址', width: 300}
                    ,{field: 'record', title: '接口参数详情', width: 700}
                    ,{field: 'updateTime', title: '更新时间', width: 200,templet:function(r){
                       return  layui.util.toDateString(r.updateTime, 'yyyy-MM-dd HH:MM:ss');
                    }, sort: true}
            ]
            ]
                ,page:true
                // ,skin:"line"
                ,id:'swaggerLogReload'
        });

        $('#search_btn').on("click", function () {
            table.reload("swaggerLogReload", {
                method:"get",
                url: "/va/swaggerLogList?name="+$("#apiname").val(),
                page:1
            })
        })

        $('#search .layui-btn').on('click', function(){
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });

    });

</script>

</body>
</html>

